<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript" src="js/jquery-1.10.2.min.js">
</script>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Login</title>
  <link rel="shortcut icon"  href="images/zk.ico" type="image/x-icon" />
  <link rel="stylesheet" href="lib/layui/css/layui.css">
  <link rel="stylesheet" href="css/login.css">
    <script type="text/javascript">
  
      //获取主机地址+项目名，如：//localhost:8080/hospital
 var ctx = "${ctx}";
  </script>
</head>
<body>
 
 
 
 
 
 

		
<form action="gaiSuff">

<input type="text" value="${l.sid}" name="sid" style="display:none;">
病人名:<input type="text" value="${l.sname}" name="sname">

性别:<select name="ssex" >   
                <option value="1" <c:if test="${l.ssex==1}">selected</c:if>>男</option>   
                <option value="2" <c:if test="${l.ssex==2}">selected</c:if>>女</option>  </select> 
年龄:<input type="text" value="${l.sage}"name="sage" maxlength="2">
手机号:<input type="text" value="${l.sphone}"name="sphone"maxlength="11">
地址:<input type="text" value="${l.saddre}"name="saddre"><br>
所属科室:<select id="department"  class="chzn-select" data-placeholder="-请选择-" onchange="finddoctor()">
										<option value="${l.dept.deid}">${l.dept.dename}</option>
										<c:forEach var="item" items="${list2}">
											<option value="${item.deid}" />${item.dename}</c:forEach></select>
选择医生:<select id="doctor" name="eid" class="chzn-select" data-placeholder="-请选择-">
		<option class="aa" id="all" value="${l.eid}">${l.emp.ename}</option></select>
挂号时间:<input type="text" value="${l.stime}" name="stime" readonly="true"><br> 
就诊状态:<select name="sstate">
			<option value="1" <c:if test="${l.sstate==1}">selected</c:if>>未就诊</option>
			<option value="2" <c:if test="${l.sstate==2}">selected</c:if>>已就诊</option>
		      </select> 					
							
						


			<input type="submit" value="確定修改">
	</form>
		<br>


	<script type="text/javascript">
	//根据科室部门查询医生
	 function getselect(){
		 document.getElementById("all").style.display="none";
		$(".aa").nextAll().remove();
		$("#all").nextAll().remove();
		$.post(ctx+"/getdoctorbydptid.do",
		{deid:$("#department").val() == "" ? 0 : $("#department").val()},
		
		function(data){					
			$.each(data,function(name,value) {
				$("#doctor").append("<option value='"+value['eid']+"'>"+value['ename'] + "</option>");
			});
			$("#doctor").val(0);
			$("#doctor").trigger("liszt:updated");
    		$("#doctor").chosen();
		});
	}
	
	 function alertTest()
	  {
	  alert("下拉框内容发生改变")
	  }
	//根据科室部门查询医生
	function finddoctor(){
		getselect();
		//alertTest();
	}
	
	
	</script>	

</body>

 
</html>